<script>
function addDepartment(){
    
    var dn = $("input[name='dn']").val();
    var obj = sendRequest("departmentFunctions.php?cmd=2&dn="+dn);  

    if(obj.result == 1){
            showStatus(obj);
            getAllDepartments();

    }else{
           showStatus(obj); 
    }
}
</script>

<form action="" method="post" id="add-form">
                <legend> Add Department Information </legend>
                <table class="add">
                    <tr id="add-icon">
                        <td colspan="2">
                        <span class="flaticon-hospital15"></span>
                        </td>
                    </tr>
                <input type="hidden" name="did" >
                <tr>
                    <td>
                Department name: </td>
                    <td><input type="text" size="40"name="dn" >
                    </td>
                </tr>
                
                <tr class="add-button">
                    <td colspan="2">
                        <input type="button" value="add" onclick="addDepartment()">
                    </td>
                </tr>
                </table>
          
        </form>  

